package com.sali.asyncollection.controller.asyn_request;


import com.sali.asyncollection.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * @description: 测试异步请求
 * @author: sali
 * @date: 2024/7/21 下午2:52.
 * @version: 1.0
 */
@RequestMapping("/admin/v1")
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/order/make")
    public boolean makeOrder() throws ExecutionException, InterruptedException {
        Long userId = 10000L;
        Long productId = 100L;
        return orderService.makeOrder(userId, productId);
    }




}
